<template>
  <div class="container">

      <div class="nav">
        <div class="top_banner">
          <div @click="FanHui" class="iconfont icon-xiangzuo myicon"></div>
          <div class="mymusic">歌单</div>
        </div>

        <div>
          <img class="myimg" :src="this.$route.query.musicPicture" alt />
          <p class="myname">{{this.$route.query.musicName}}</p>
        </div>
      </div>
      <div>
        <ul >
         
          <li class="demo1" v-for="(item,index) in gmlist" :key="item.id">
            <p class="count">{{index+1}}</p>
            <div class="demo2" >
              <div class="demo3" >{{item.name}}</div>
              <!-- <h2 class="demo3">{{item.name}}</h2> -->
              <p class="demo4">{{item.ar[0].name}}</p>
            </div>
          </li>
        </ul>
      </div>

  </div>
</template>

<script>

import axios from "axios";
export default {
  data() {
    return {
      gslist: [],
      gmlist: [],
      idlist:[]
    };
  },
  methods: {
    FanHui() {
        //回退上一页
      this.$router.push({
        name: "recommend",
      })
    }
  },

  created() {
    axios.get(
        "https://netease.bluej.cn/playlist/detail?id=" + this.$route.query.myId
      )
      .then(res => {
        console.log(res.data);
        // 歌手  data.playlist.tracks[1].ar
        // 歌名  data.playlist.tracks
        this.gmlist=res.data.playlist.tracks;
        this.gslist=res.data.playlist.tracks[0].ar[0].name
        
        //  playlist.tracks
        // console.log(this.gslist);
        // console.log(this.gmlist);
        // console.log(res.data.playlist.trackIds);
        // this.idlist=res.data.playlist.id;
        
        
        
      })
      .catch(err => {
        console.log(err);
      });
  }
};
</script>

<style scoped>
* {
  padding: 0;
  margin: 0;
  list-style: none;
}
.top_banner {
  width: 100%;
  height: 35px;
  background-color: #87ceeb;
}
.nav {
  width: 100%;
  height: 260px;
  /* border: 1px solid red; */
  position: relative;
}
.myicon {
  float: left;
  padding: 15px 0 0 15px;
}
.mymusic {
  float: left;
  padding-top: 10px;
}
.myimg {
  width: 100%;
  height: 223px;
}
.myname {
  position: absolute;
  left: 20px;
  bottom: 20px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1;
  color: #fff;
}
.banner {
  width: 100%;
  height: 60px;
  border: solid 1px aqua;
}
.demo1{
      position: relative;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    box-sizing: border-box;
    height: 60px;
    border-bottom: 1px solid #e4e4e4;
}
.count{
      flex: 0 0 50px;
    width: 50px;
    text-align: center;
    color: #757575;
}
.demo2{
      flex: 1;
    line-height: 20px;
    overflow: hidden;
}
.demo3{
  margin-top: 4px;
    width: 80%;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    color: #2e3030;
}
.demo4{
      text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    width: 80%;
    font-size: 12px;
    color: #757575;
}

</style>